<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/7
 * Time: 15:22
 */

namespace app\index\controller;


use think\Controller;
use think\Db;

class Calendar extends Controller
{
    public function index()
    {
       return $this->fetch();
    }

    public function add()
    {
        $price_content = input('post.price_content/a');
        $id = input('post.id');
//        var_dump($id);
//        die;
        $data['price_content'] = json_encode($price_content);

        $res = Db::name('trip')->where('id',$id)->update($data);

        if($res){
            return json_encode(1);
        }else{
            return json_encode(0);
        }
//        foreach ($data as $value)
//        {
//            $info['date'] =$value['date'];
//            $info['stock'] =$value['stock'];
//            dump($info);
//        }
//
//        die;
    }
}